
var maipBridge = {


    networkInfo(showHud,hiddenHudWhenComplete,hiddenHudWhenError,infos){
        console.log(showHud,hiddenHudWhenComplete,hiddenHudWhenError,infos)
        if(is_android()){
            window.jsBridge.networkInfo(showHud,hiddenHudWhenComplete,hiddenHudWhenError,infos);
        }
        if(is_iphone()){
            window.webkit.messageHandlers.download.networkInfo({'showHud':showHud,'hiddenHudWhenComplete':hiddenHudWhenComplete,'hiddenHudWhenError':hiddenHudWhenError,'infos':infos});
        }

    }

}



var ua = navigator.userAgent.toLowerCase();
//判断环境
function is_android(){
    if(ua.match(/android/i)=='android'&&ua.match(/iemobile/i)!='iemobile'){
         return true;
    } else {
         return false;
    }
}
function is_iphone(){
    if(ua.match(/iphone/i)=='iphone'&&ua.match(/iemobile/i)!='iemobile'){
         return true;
    } else {
         return false;
    }
}


export default maipBridge






